﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HCDV.HCSP
{

    public class QueryBll
    {
        public DataTable getReportPage(string tableInfo, string reFiles, int pagenew, int pagesize, string whereinfo, string orders, out int allpage)
        {
            DataTable table;
            using (dbsimpleold acess = new dbsimpleold())
            {
                table = acess.getSimplePageInfo(tableInfo, reFiles, ((pagenew - 1) * pagesize + 1).ToString(), (pagenew * pagesize).ToString(), whereinfo, orders, out allpage);
            }
            return table;
        }
        public DataTable getReportPage(string tableInfo, string reFiles, int pagenew, int pagesize, string whereinfo, out int allpage)
        {
            DataTable table;
            using (dbsimpleold acess = new dbsimpleold())
            {
                table = acess.getSimplePageInfo(tableInfo, reFiles, ((pagenew - 1) * pagesize + 1).ToString(), (pagenew * pagesize).ToString(), whereinfo, out allpage);
            }
            return table;
        }
        public DataTable getReportNoPage(string tableInfo, string reFiles, string whereinfo)
        {
            DataTable table;
            int allpage;
            using (dbsimpleold acess = new dbsimpleold())
            {
                table = acess.getSimplePageInfo(tableInfo, reFiles, "", "all", whereinfo, out allpage);
            }
            return table;
        }
        public DataTable getReportNoPage(string tableInfo, string reFiles, string whereinfo, string orders)
        {
            DataTable table;
            int allpage;
            using (dbsimpleold acess = new dbsimpleold())
            {
                table = acess.getSimplePageInfo(tableInfo, reFiles, "", "all", whereinfo, orders, out allpage);
            }
            return table;
        }
      
       

    }
}
